import request from "./request"

export const createRepair = async repairForm =>{
  return await request({
    method:"POST",
    url:"/repair/create",
    data:repairForm
  })
}

export const findRepairByUserId = async (userId,limit,skip) =>{
  return await request({
    method:"GET",
    url:"/repair/find_by_userId",
    data:{
      userId,
      limit,
      skip
    }
  })
}

export const updateRepairStateById = async(id,state)=>{
  return request({
    method:"POST",
    url:"/repair/update/state",
    data:{
      id,
      state
    }
  })
}

export const updateRepairFinishTime = async(id,finishTime)=>{
  return await request({
    method:"POST",
    url:"/repair/update/finishTime",
    data:{
      id,
      finishTime
    }
  })
}